package cn.common.config;




import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * Copyright
 *
 * @Author WuHuang
 * @Date 2022/12/21
 */
@Configuration
@RefreshScope
@ConfigurationProperties(
        prefix = "basic.retry.config"
)
public class BasicRetryConfig {
    private int sendMessageMaxCount = 3;

    public BasicRetryConfig() {
    }

    public int getSendMessageMaxCount() {
        return this.sendMessageMaxCount;
    }

    public void setSendMessageMaxCount(final int sendMessageMaxCount) {
        this.sendMessageMaxCount = sendMessageMaxCount;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof BasicRetryConfig)) {
            return false;
        } else {
            BasicRetryConfig other = (BasicRetryConfig)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                return this.getSendMessageMaxCount() == other.getSendMessageMaxCount();
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof BasicRetryConfig;
    }

    public int hashCode() {
        int result = 1;
        result = result * 59 + this.getSendMessageMaxCount();
        return result;
    }

    public String toString() {
        return "BasicRetryConfig(sendMessageMaxCount=" + this.getSendMessageMaxCount() + ")";
    }
}

